<?php
/**
 * @version		$Id: controller.php 14974 2010-02-21 14:32:22Z ian $
 * @package		Joomla
 * @subpackage	Contact
 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
 * @license		GNU/GPL, see LICENSE.php
 * Joomla! is free software. This version may have been modified pursuant to the
 * GNU General Public License, and as distributed it includes or is derivative
 * of works licensed under the GNU General Public License or other free or open
 * source software licenses. See COPYRIGHT.php for copyright notices and
 * details.
 */

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die( 'Restricted access' );

jimport( 'joomla.application.component.controller' );

/**
 * Contact Component Controller
 *
 * @static
 * @package		Joomla
 * @subpackage	Contact
 * @since 1.5
 */
class CheckemailController extends JController
{
	/**
	 * Display the view
	 */
	function display()
	{
		parent::display();
	}

	/**
	 * Save and send mail
	 *
	 * @static
	 * @since 1.0
	 */
	function check()
	{
		$email = JRequest::getVar( 'email', '' );
		$exsits = '';
		if ($email!='')
		{
			$model = &$this->getModel( 'Checkemail' );
			$exsits = $model->check( $email );
			
		}
		$document =& JFactory::getDocument();
		
        $view  =& $this->getView('checkemail', $document->getType()); 
        $view->assign('exists',$exsits);
  		$view->display();
		
		//echo $exsits;
	}

}
